package com.ddsfec.loginapi.user.entity;

import lombok.Data;

/**
 * Json数据封装类
 */
@Data
public class JsonResultVo {
    private String code;
    private String desc;
    private Object data;

    private JsonResultVo(){}

    public static JsonResultVo createSuccessJsonResult(Object data){
        JsonResultVo vo = new JsonResultVo();
        vo.code = "10000";
        vo.data = data;
        return vo;
    }

    public static JsonResultVo createFailJsonResult(String code, String desc){
        JsonResultVo vo = new JsonResultVo();
        vo.code = code;
        vo.desc = desc;
        return vo;
    }
}
